package tjs.study.notes.alibaba.order.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * Created by Nicky.Tang on 2022/1/2 4:20 下午
 *
 * @since 02.12.10
 */
@Service
public class OrderServiceAli {
    private static final Logger log = LoggerFactory.getLogger(OrderServiceAli.class);
    @Autowired
    private Environment environment;

    public String buy(String userId) {
        String orderId = environment.getProperty("server.port") + "_" + UUID.randomUUID().toString();
        log.info("1. 生成订单信息");
        return orderId;
    }
}
